{template 'public/header'}
{template 'public/comhead'}
<input type="hidden" name="schoolid" value="{$schoolid}" />
<div class="panel panel-info">

    <div class="panel-body">
        {php echo $this -> set_tabbar($action, $schoolid);}
    </div>
</div>
<ul class="nav nav-tabs">
    <li {if $operation == 'post'}class="active"{/if}><a href="{php echo $this->createWebUrl('coursesort', array('op' => 'post', 'schoolid' => $schoolid))}">添加基本信息</a></li>
    <li {if $operation == 'display'}class="active"{/if}><a href="{php echo $this->createWebUrl('coursesort', array('op' => 'display', 'schoolid' => $schoolid))}">管理</a></li>
</ul>
<style>
    .cLine {
        overflow: hidden;
        padding: 5px 0;
        color:#000000;
    }
    .alert {
        padding: 8px 35px 0 10px;
        text-shadow: none;
        -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        -moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        background-color: #f9edbe;
        border: 1px solid #f0c36d;
        -webkit-border-radius: 2px;
        -moz-border-radius: 2px;
        border-radius: 2px;
        color: #333333;
        margin-top: 5px;
    }
    .alert p {
        margin: 0 0 10px;
        display: block;
    }
    .alert .bold{
        font-weight:bold;
    }
</style>
<div class="cLine">
    <div class="alert">
        <p><span class="bold">使用方法：</span>
            <strong><font color='red'>特别提醒: 当你删除该星期项的时候,该星期项下相关的所有数据都会被删除,请谨慎操作!以免丢失数据!</font></strong>

            填写班级,如 星期一,星期二,星期三....
        </p>
    </div>
</div>

{if $operation == 'post'}
<div class="main">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <input type="hidden" name="schoolid" value="{$schoolid}" />
        <div class="panel panel-default">
            <div class="panel-heading">
                星期分类编辑
            </div>
            <div class="panel-body">
                {if !empty($parentid)}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">上级分类</label>
                    <div class="col-sm-9">
                        {$parent['name']}
                    </div>
                </div>
                {/if}
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">排序</label>
                    <div class="col-sm-9">
                        <input type="text" name="ssort" class="form-control" value="{$week['ssort']}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">学校名称</label>
                    <div class="col-sm-9">
                        <input type="text" name="schoolName" class="form-control" value="{$week['sname']}" />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">学期名称</label>
                    <div class="col-sm-9">
                        <input type="text" name="semesterName" class="form-control" value="{$week['sname']}" />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">每周天数</label>
                    <div class="col-sm-9">
                        <input type="text" name="weekNum" class="form-control" value="{$week['sname']}" />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">上午节数</label>
                    <div class="col-sm-9">
                        <input type="text" name="shangwuNum" class="form-control" value="{$week['sname']}" />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">下午节数</label>
                    <div class="col-sm-9">
                        <input type="text" name="xiawuNum" class="form-control" value="{$week['sname']}" />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">晚上节数</label>
                    <div class="col-sm-9">
                        <input type="text" name="nightNum" class="form-control" value="{$week['sname']}" />
                    </div>
                </div>


                晚上节数




            </div>
        </div>
        <div class="form-group col-sm-12">
            <input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
            <input type="hidden" name="token" value="{$_W['token']}" />
        </div>
    </form>
</div>
{elseif $operation == 'display'}
<div class="main">
    <div class="panel panel-default">
        <div class="panel-body">
            <a class="btn btn-primary" href="javascript:location.reload()"><i class="fa fa-refresh"></i>刷新</a>
        </div>
    </div>
    <div class="panel panel-default">
        <form action="" method="post" class="form-horizontal form" >
            <input type="hidden" name="schoolid" value="{$schoolid}" />
            <div class="table-responsive panel-body">
                <table class="table table-hover">
                    <thead class="navbar-inner">
                    <tr>
                        <th style="width:100px;">序号</th>
                        <th>学校名称</th>
                        <th>学期名称</th>
                        <th>每周天数</th>
                        <th>上午节数</th>
                        <th>下午节数</th>
                        <th>晚上节数</th>
                        <th style="text-align:right;">编辑/删除</th>
                    </tr>
                    </thead>
                    <tbody id="level-list">
                    {loop $allCourse $row}
                    <tr>
                        <td><div class="type-parent">{$row['ssort']}</div></td>
                        <td><div class="type-parent">{$row['schoolName']}</div></td>
                        <td><div class="type-parent">{$row['semesterName']}</div></td>
                        <td><div class="type-parent">{$row['weekNum']}</div></td>
                        <td><div class="type-parent">{$row['shangwuNum']}</div></td>
                        <td><div class="type-parent">{$row['xiawuNum']}</div></td>
                        <td><div class="type-parent">{$row['nightNum']}</div></td>


                        <td style="text-align:right;">
                            <a class="btn btn-default btn-sm" href="{php echo $this->createWebUrl('courseSort', array('op' => 'post', 'sid' => $row['sid'], 'schoolid' => $schoolid))}" title="编辑">
                                <i class="fa fa-pencil"></i>
                            </a>

                            <a class="btn btn-default btn-sm" href="{php echo $this->createWebUrl('week', array('op' => 'delete', 'sid' => $row['sid'], 'schoolid' => $schoolid))}" onclick="return confirm('确认删除此分类吗？');return false;" title="删除">
                                <i class="fa fa-times"></i>
                            </a>
                        </td>


                    </tr>
                    {/loop}
                    </tbody>
                </table>
            </div>
        </form>
    </div>
    {$pager}
</div>
{/if}
{template 'public/footer'}